package com.design.cjm.behavioral.chainofresponsibility.example;

/**
 * 定义一个处理请求的接口
 *
 * @Author: Jie Ming Chen
 * @Date: 2018/9/25
 * @Version 1.0
 */
public abstract class Handler {

    protected Handler successor;

    /**
     * 设置继任者
     *
     * @param successor
     */
    public void setSuccessor(Handler successor) {
        this.successor = successor;
    }

    /**
     * 处理请求的抽象方法
     *
     * @param request
     */
    public abstract void handleRequest(int request);
}
